import Vue from 'vue'
import Router from 'vue-router';
Vue.use(Router);
import Layout from '@/layout';
const data = [{
		path: '/login',
		component: () => import('@/views/login/index'),
		hidden: true
	},
	{
		path: '/',
		redirect: '/liftAddress'
	},
	{
		path: '/liftAddress',
		component: Layout,
		name: '电梯信息',
		titleName: '电梯信息',
		icon: 'lift',
		children: [{
			path: '/liftAddress',
			name: '电梯信息',
			component: () => import('@/views/liftAddress/list'),
			meta: {
				parentName: '电梯信息',
				title: '电梯信息',
			}
		}]
	},
	{
		path: '/displayModule',
		component: Layout,
		name: '数字孪生模型展示', 
		titleName: '数字孪生模型展示',
		redirect: '/elevatorIndex',
		icon: 'display',
		children: [{
				path: '/elevator',
				name: '直梯', 
				redirect: '/elevatorIndex',
				component: () => import('@/views/display/elevatorZ/index'), 
				children: [{
					path: '/elevatorIndex',
					name: '直梯',
					component: () => import('@/views/display/elevatorZ/list'),
					meta: {
						parentName: '数字孪生模型展示',
						title: '直梯',
						activeMenu: '/elevator',
						parents: 'displayModule'
					}
				}]
			},

			{
				path: '/escalator',
				parentName: '数字孪生模型展示',
				name: '扶梯',
				redirect: '/escalatorIndex',
				component: () => import('@/views/display/escalatorF/index'),
				meta: {
					// title: '展示模块', 

				},
				children: [{
					path: '/escalatorIndex',
					hidden: true,
					name: '扶梯',
					component: () => import('@/views/display/escalatorF/list'),
					meta: {
						parentName: '数字孪生模型展示',
						title: '扶梯',
						activeMenu: '/escalator',
						parents: 'displayModule'
					},
				}]
			},


		]
	},
 
	
	{
		path: '/earlyWarning',
		component: Layout,
		name: '风险推演与预警',
		titleName: '风险推演与预警',
		redirect: '/elevatorWarning',
		icon: 'risk',
	
		children: [{
				path: '/elevatorWarningIndex',
				name: '直梯',
				parentName: '风险推演与预警',
				redirect: '/elevatorWarning',
				component: () => import('@/views/warning/elevatorZ/index'),
				meta: {
					title: '直梯',
					parents: 'earlyWarning'
				},
				children: [{
					path: '/elevatorWarning',
					name: '直梯',
					component: () => import('@/views/warning/elevatorZ/list'),
					meta: {
						parentName: '风险推演与预警',
						activeMenu: '/elevatorWarningIndex',
						parents: 'earlyWarning'
					}
				}]
			},
	
			{
				path: '/escalatorWarningIndex',
				parentName: '风险推演与预警',
				name: '扶梯',
				redirect: '/escalatorWarning',
				component: () => import('@/views/warning/escalatorF/index'),
	
				children: [{
					path: '/escalatorWarning',
					hidden: true,
					name: '扶梯',
					component: () => import('@/views/warning/escalatorF/list'),
					meta: {
						parentName: '风险推演与预警',
						title: '扶梯',
						activeMenu: '/escalatorWarningIndex',
						parents: '/escalatorWarningIndex'
					},
				}]
			},
	
		]
	},
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	{
		path: '/fault',
		component: Layout,
		name: '故障诊断与回溯',
		titleName: '故障诊断与回溯',
		redirect: '/elevatorFault',
		icon: 'fault',

		children: [{
				path: '/elevatorFaultIndex',
				name: '直梯',
				parentName: '故障诊断与回溯',
				redirect: '/elevatorFault',
				component: () => import('@/views/fault/elevatorZ/index'),
				meta: {
					title: '直梯',
					parents: 'fault'
				},
				children: [{
					path: '/elevatorFault',
					name: '直梯',
					component: () => import('@/views/fault/elevatorZ/list'),
					meta: {
						parentName: '故障诊断与回溯',
						activeMenu: '/elevatorFaultIndex',
						parents: 'fault'
					}
				}]
			},

			{
				path: '/escalatorFaultIndex',
				parentName: '故障诊断与回溯',
				name: '扶梯',
				redirect: '/escalatorFault',
				component: () => import('@/views/fault/escalatorF/index'),

				children: [{
					path: '/escalatorFault',
					hidden: true,
					name: '扶梯',
					component: () => import('@/views/fault/escalatorF/list'),
					meta: {
						parentName: '故障诊断与回溯',
						title: '扶梯',
						activeMenu: '/escalatorFaultIndex',
						parents: '/escalatorFaultIndex'
					},
				}]
			},

		]
	},

	 
	{
		path: '/standardsLaws',
		component: Layout,
		name: '法规标准体系文件', 
		titleName: '法规标准体系文件',
		redirect: '/lawsIndex',
		icon: 'laws',
		children: [{
				path: '/laws',
				name: '法规', 
				redirect: '/lawsIndex',
				component: () => import('@/views/standards/laws/index'), 
				children: [{
					path: '/lawsIndex',
					name: '法规',
					component: () => import('@/views/standards/laws/list'),
					meta: {
						parentName: '法规标准体系文件',
						title: '法规',
						activeMenu: '/laws',
						parents: 'standardsLaws'
					}
				}]
			},
	
			{
				path: '/standard',
				parentName: '法规标准体系文件',
				name: '标准',
				redirect: '/standardIndex',
				component: () => import('@/views/standards/standard/index'),
				meta: {
					title: '法规标准体系文件', 
	
				},
				children: [{
					path: '/standardIndex',
					hidden: true,
					name: '标准',
					component: () => import('@/views/standards/standard/list'),
					meta: {
						parentName: '法规标准体系文件',
						title: '标准',
						activeMenu: '/standard',
						parents: 'standardsLaws'
					},
				}]
			},
	
	
		]
	},

	{
		path: '/wisdomIndex',
		component: Layout,
		name: '智慧决策支持',
		titleName: '智慧决策支持',
		redirect: '/elevatorWisdom',
		icon: 'wisdom', 
		children: [{
				path: '/elevatorWisdomIndex',
				name: '直梯',
				redirect: '/elevatorWisdom',
				component: () => import('@/views/wisdom/elevatorZ/index'),
				meta: {
					title: '直梯',
					parentName: '智慧决策支持',
				},
				children: [{
						meta: {
							parentName: '智慧决策支持',
							activeMenu: '/elevatorWisdomIndex',
							parents: '/elevatorWisdomIndex',
						},
						path: '/elevatorWisdom',
						name: '直梯',
						component: () => import(
							'@/views/wisdom/elevatorZ/list')
					} 
				]
			},
			{
				path: '/escalatorWisdomIndex',
				name: '扶梯',
				parentName: '智慧决策支持',
				titleName: '扶梯',
				component: () => import('@/views/wisdom/escalatorF/index'),
				redirect: '/escalatorWisdom',
				meta: {
					title: '扶梯',
				},
				children: [

					{
						meta: {
							parentName: '智慧决策支持',
							activeMenu: '/escalatorWisdomIndex',
							parents: '/escalatorWisdomIndex',
						},
						path: '/escalatorWisdom',
						name: '扶梯',
						component: () => import('@/views/wisdom/escalatorF/list')
					}
				],
			} 
		]
	},


	// {
	// 	path: '/rtcIndex',
	// 	component: Layout,
	// 	redirect: '/assistance',
	// 	size: '1',
	// 	name: '协作',
	// 	titleName: '协作',
	// 	icon: 'rtc',
	// 	children: [{
	// 			path: '/assistance',
	// 			name: '协作',
	// 			component: () => import('@/views/assets/index'),
	// 			meta: {
	// 				title: '协作',
	// 				parentName: '协作',
	// 				activeMenu: '/rtcIndex',
	// 				parents: '/assistance'
	// 			},
	// 		},
	// 		{
	// 			path: '/admission',
	// 			name: '协作存储',
	// 			hidden: true,
	// 			component: () => import('@/views/assets/history/index'),
	// 			redirect: '/rtcHistoryList',
	// 			meta: {
	// 				title: '协作',
	// 				parentName: '协作',
	// 				activeMenu: '/rtcIndex',
	// 				parents: '/assistance'
	// 			},
	// 			children: [{
	// 					path: '/rtcHistoryList',
	// 					name: '历史记录',
	// 					component: () => import('@/views/assets/history/list'),

	// 					meta: {
	// 						title: '历史记录',
	// 						icon: 'form',
	// 						parentName: '协作',
	// 						activeMenu: '/rtcIndex',
	// 						parents: '/assistance'
	// 					}
	// 				},
	// 				{
	// 					path: '/rtcHistoryDetail',
	// 					name: '协作录制详情',
	// 					component: () => import('@/views/assets/history/detail'),
	// 					meta: {
	// 						title: '协作录制详情',
	// 						parentName: '协作',
	// 						activeMenu: '/rtcIndex',
	// 						parents: '/rtcHistoryList'
	// 					}
	// 				}
	// 			]
	// 		}
	// 	]
	// },
	// {
	// 	path: '/interface',
	// 	name: '协作界面',
	// 	component: () => import('@/views/assets/interface'),
	// 	meta: {
	// 		title: '协作界面',
	// 		icon: 'form'
	// 	}
	// },
	 // 404 page must be placed at the end !!!
	{
		path: '/404',
		component: () => import('@/views/404'),
		hidden: true
	},
	{
		path: '*',
		redirect: '/404',
		hidden: true
	},
]
export const constantRoutes = data

const createRouter = () => new Router({
	// mode: 'history', // require service support
	scrollBehavior: () => ({
		y: 0
	}),
	routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
	const newRouter = createRouter()
	router.matcher = newRouter.matcher // reset router
}
export default router